package com.cskaoyan.util;

import com.cskaoyan.bean.pojo.MallUser;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

/**
 * @author: Fengyi
 * @description:
 * @time: 2021/7/13 15:36
 */
public class CurrentUesr {

    public static int getUserId() {
        Subject subject = SecurityUtils.getSubject();
        MallUser user = (MallUser) subject.getPrincipals().getPrimaryPrincipal();
        return user.getId();
    }
}
